<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>活动预告 - 流光小队</title>
    <link rel="stylesheet" href="../../css/style.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <style>
        .activities-section {
            max-width: 1200px;
            margin: 0 auto;
            padding: 40px 20px;
        }

        .activities-header {
            text-align: center;
            margin-bottom: 50px;
        }

        .activities-header h1 {
            font-size: 2.5em;
            color: #2d3748;
            margin-bottom: 15px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .activities-header p {
            font-size: 1.2em;
            color: #718096;
            max-width: 600px;
            margin: 0 auto;
        }

        .activities-filters {
            display: flex;
            justify-content: center;
            gap: 15px;
            margin-bottom: 40px;
            flex-wrap: wrap;
        }

        .filter-btn {
            padding: 10px 20px;
            border: 2px solid #e2e8f0;
            border-radius: 25px;
            background: white;
            color: #4a5568;
            font-size: 0.9em;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .filter-btn.active {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border-color: #667eea;
        }

        .filter-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
        }

        .activities-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
            gap: 30px;
            margin-bottom: 50px;
        }

        .activity-card {
            background: white;
            border-radius: 16px;
            overflow: hidden;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
            border: 1px solid #e2e8f0;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .activity-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
        }

        .activity-image {
            width: 100%;
            height: 200px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 3em;
            position: relative;
        }

        .activity-image::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.8) 0%, rgba(118, 75, 162, 0.8) 100%);
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .activity-card:hover .activity-image::before {
            opacity: 1;
        }

        .activity-status {
            position: absolute;
            top: 15px;
            right: 15px;
            padding: 5px 12px;
            border-radius: 15px;
            font-size: 0.8em;
            font-weight: 600;
            color: white;
        }

        .status-upcoming {
            background: #38a169;
        }

        .status-registration {
            background: #3182ce;
        }

        .status-soon {
            background: #d69e2e;
        }

        .activity-content {
            padding: 25px;
        }

        .activity-title {
            font-size: 1.3em;
            font-weight: 600;
            color: #2d3748;
            margin-bottom: 10px;
            line-height: 1.4;
        }

        .activity-meta {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-bottom: 15px;
            font-size: 0.9em;
            color: #718096;
        }

        .meta-item {
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .meta-item i {
            color: #667eea;
        }

        .activity-description {
            color: #4a5568;
            line-height: 1.6;
            margin-bottom: 20px;
        }

        .activity-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 20px;
        }

        .activity-tag {
            background: #f7fafc;
            color: #4a5568;
            padding: 4px 12px;
            border-radius: 15px;
            font-size: 0.85em;
            font-weight: 500;
        }

        .activity-actions {
            display: flex;
            gap: 10px;
        }

        .action-btn {
            flex: 1;
            padding: 10px 15px;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            background: white;
            color: #4a5568;
            font-size: 0.9em;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
            text-decoration: none;
        }

        .action-btn:hover {
            background: #667eea;
            color: white;
            border-color: #667eea;
        }

        .action-btn.primary {
            background: #667eea;
            color: white;
            border-color: #667eea;
        }

        .action-btn.primary:hover {
            background: #5a67d8;
        }

        .countdown-section {
            background: #f7fafc;
            border-radius: 16px;
            padding: 30px;
            margin-bottom: 40px;
        }

        .countdown-header {
            text-align: center;
            margin-bottom: 30px;
        }

        .countdown-header h2 {
            font-size: 1.8em;
            color: #2d3748;
            margin-bottom: 10px;
        }

        .countdown-header p {
            color: #718096;
        }

        .countdown-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 20px;
        }

        .countdown-item {
            background: white;
            border-radius: 12px;
            padding: 20px;
            text-align: center;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
        }

        .countdown-number {
            font-size: 2em;
            font-weight: bold;
            color: #667eea;
            margin-bottom: 5px;
        }

        .countdown-label {
            color: #718096;
            font-size: 0.9em;
        }

        .featured-activity {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-radius: 16px;
            padding: 40px;
            color: white;
            margin-bottom: 40px;
        }

        .featured-header {
            text-align: center;
            margin-bottom: 30px;
        }

        .featured-header h2 {
            font-size: 2em;
            margin-bottom: 10px;
        }

        .featured-content {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 30px;
            align-items: center;
        }

        .featured-info h3 {
            font-size: 1.5em;
            margin-bottom: 15px;
        }

        .featured-info p {
            line-height: 1.6;
            margin-bottom: 20px;
            opacity: 0.9;
        }

        .featured-stats {
            display: flex;
            gap: 20px;
            margin-bottom: 20px;
        }

        .featured-stat {
            text-align: center;
        }

        .featured-stat-number {
            font-size: 1.5em;
            font-weight: bold;
            margin-bottom: 5px;
        }

        .featured-stat-label {
            font-size: 0.9em;
            opacity: 0.8;
        }

        .featured-actions {
            display: flex;
            gap: 15px;
        }

        .featured-btn {
            padding: 12px 24px;
            border: 2px solid white;
            border-radius: 25px;
            background: transparent;
            color: white;
            font-size: 1em;
            cursor: pointer;
            transition: all 0.3s ease;
            text-decoration: none;
        }

        .featured-btn:hover {
            background: white;
            color: #667eea;
        }

        .featured-btn.primary {
            background: white;
            color: #667eea;
        }

        .featured-btn.primary:hover {
            background: transparent;
            color: white;
        }

        @media (max-width: 768px) {
            .activities-filters {
                gap: 10px;
            }

            .filter-btn {
                padding: 8px 16px;
                font-size: 0.85em;
            }

            .activities-grid {
                grid-template-columns: 1fr;
                gap: 20px;
            }

            .countdown-grid {
                grid-template-columns: repeat(2, 1fr);
            }

            .featured-content {
                grid-template-columns: 1fr;
                gap: 20px;
            }

            .featured-stats {
                justify-content: center;
            }
        }
    </style>
</head>
<body>
    <!-- 侧边栏 -->
    <div class="sidebar" id="sidebar">
        <div class="sidebar-header">
            <h3>流光小队</h3>
            <button class="sidebar-toggle" onclick="toggleSidebar()">
                <i class="fas fa-times"></i>
            </button>
        </div>
        <nav class="sidebar-nav">
            <ul>
                <li>
                    <a href="../../index.html">
                        <i class="fas fa-home"></i>
                        首页
                    </a>
                </li>
                <li>
                    <a href="../about/index.html">
                        <i class="fas fa-info-circle"></i>
                        关于我们
                    </a>
                </li>
                
                <!-- 成员相关 -->
                <li>
                    <a href="../members/index.html">
                        <i class="fas fa-users"></i>
                        成员介绍
                    </a>
                </li>
                <li>
                    <a href="../excellent/index.html">
                        <i class="fas fa-star"></i>
                        优秀成员
                    </a>
                </li>
                
                <!-- 活动相关 -->
                <li class="active">
                    <a href="upcoming.html">
                        <i class="fas fa-calendar-alt"></i>
                        活动预告
                    </a>
                </li>
                <li>
                    <a href="past.html">
                        <i class="fas fa-history"></i>
                        往期活动
                    </a>
                </li>
                <li>
                    <a href="calendar.html">
                        <i class="fas fa-calendar"></i>
                        活动日历
                    </a>
                </li>
                
                <!-- 成果与资源 -->
                <li>
                    <a href="../achievements/index.html">
                        <i class="fas fa-trophy"></i>
                        小组成果
                    </a>
                </li>
                <li>
                    <a href="../resources/index.html">
                        <i class="fas fa-book"></i>
                        学习资料
                    </a>
                </li>
                <li>
                    <a href="../resources/shares.html">
                        <i class="fas fa-share-alt"></i>
                        成员分享
                    </a>
                </li>
                
                <!-- 互动与讨论 -->
                <li>
                    <a href="../interaction/index.html">
                        <i class="fas fa-comments"></i>
                        互动交流
                    </a>
                </li>
                
                <!-- 加入与联系 -->
                <li>
                    <a href="../join/index.html">
                        <i class="fas fa-user-plus"></i>
                        加入我们
                    </a>
                </li>
                <li>
                    <a href="../contact/index.html">
                        <i class="fas fa-address-book"></i>
                        联系方式
                    </a>
                </li>
                
                <!-- 其他扩展 -->
                <li>
                    <a href="../partners/index.html">
                        <i class="fas fa-handshake"></i>
                        合作伙伴
                    </a>
                </li>
                <li>
                    <a href="../faq/index.html">
                        <i class="fas fa-question-circle"></i>
                        常见问题
                    </a>
                </li>
            </ul>
        </nav>
    </div>

    <!-- 主内容区域 -->
    <div class="main-content">
        <!-- 顶部导航栏 -->
        <div class="topbar">
            <div class="topbar-left">
                <button class="menu-toggle" onclick="toggleSidebar()">
                    <i class="fas fa-bars"></i>
                </button>
                <h1>活动预告</h1>
            </div>
        </div>

        <!-- 内容区域 -->
        <div class="content">
            <div class="activities-section">
                <!-- 页面标题 -->
                <div class="activities-header">
                    <h1>活动预告</h1>
                    <p>了解流光小队即将举行的精彩活动，提前做好准备</p>
                </div>

                <!-- 倒计时区域 -->
                <div class="countdown-section">
                    <div class="countdown-header">
                        <h2><i class="fas fa-clock"></i> 距离下次活动还有</h2>
                        <p>2024年春季技术分享会</p>
                    </div>
                    <div class="countdown-grid">
                        <div class="countdown-item">
                            <div class="countdown-number" id="days">15</div>
                            <div class="countdown-label">天</div>
                        </div>
                        <div class="countdown-item">
                            <div class="countdown-number" id="hours">08</div>
                            <div class="countdown-label">小时</div>
                        </div>
                        <div class="countdown-item">
                            <div class="countdown-number" id="minutes">32</div>
                            <div class="countdown-label">分钟</div>
                        </div>
                        <div class="countdown-item">
                            <div class="countdown-number" id="seconds">45</div>
                            <div class="countdown-label">秒</div>
                        </div>
                    </div>
                </div>

                <!-- 特色活动 -->
                <div class="featured-activity">
                    <div class="featured-header">
                        <h2><i class="fas fa-star"></i> 特色活动</h2>
                    </div>
                    <div class="featured-content">
                        <div class="featured-info">
                            <h3>2024年春季技术分享会</h3>
                            <p>本次分享会将邀请多位技术专家，分享最新的技术趋势和实践经验。涵盖人工智能、前端开发、后端架构等多个热门领域。</p>
                            <div class="featured-stats">
                                <div class="featured-stat">
                                    <div class="featured-stat-number">5</div>
                                    <div class="featured-stat-label">分享主题</div>
                                </div>
                                <div class="featured-stat">
                                    <div class="featured-stat-number">200+</div>
                                    <div class="featured-stat-label">参与人数</div>
                                </div>
                                <div class="featured-stat">
                                    <div class="featured-stat-number">3</div>
                                    <div class="featured-stat-label">小时时长</div>
                                </div>
                            </div>
                            <div class="featured-actions">
                                <button class="featured-btn primary" onclick="registerActivity(1)">
                                    <i class="fas fa-user-plus"></i> 立即报名
                                </button>
                                <button class="featured-btn" onclick="showActivityDetail(1)">
                                    <i class="fas fa-info-circle"></i> 了解详情
                                </button>
                            </div>
                        </div>
                        <div class="featured-image">
                            <i class="fas fa-laptop-code" style="font-size: 8em; opacity: 0.3;"></i>
                        </div>
                    </div>
                </div>

                <!-- 活动筛选 -->
                <div class="activities-filters">
                    <button class="filter-btn active" onclick="filterActivities('all')" data-filter="all">
                        <i class="fas fa-th"></i> 全部活动
                    </button>
                    <button class="filter-btn" onclick="filterActivities('tech')" data-filter="tech">
                        <i class="fas fa-code"></i> 技术分享
                    </button>
                    <button class="filter-btn" onclick="filterActivities('workshop')" data-filter="workshop">
                        <i class="fas fa-tools"></i> 工作坊
                    </button>
                    <button class="filter-btn" onclick="filterActivities('competition')" data-filter="competition">
                        <i class="fas fa-trophy"></i> 竞赛活动
                    </button>
                    <button class="filter-btn" onclick="filterActivities('social')" data-filter="social">
                        <i class="fas fa-users"></i> 社交活动
                    </button>
                </div>

                <!-- 活动列表 -->
                <div class="activities-grid" id="activitiesGrid">
                    <!-- 活动卡片将通过JavaScript动态生成 -->
                </div>
            </div>
        </div>
    </div>

    <script>
        // 活动数据
        const activities = [
            {
                id: 1,
                title: "2024年春季技术分享会",
                category: "tech",
                status: "upcoming",
                date: "2024-03-15",
                time: "14:00-17:00",
                location: "信息工程学院报告厅",
                description: "本次分享会将邀请多位技术专家，分享最新的技术趋势和实践经验。涵盖人工智能、前端开发、后端架构等多个热门领域。",
                tags: ["技术分享", "专家讲座", "免费参与"],
                icon: "💻",
                participants: 200,
                maxParticipants: 300
            },
            {
                id: 2,
                title: "UI/UX设计工作坊",
                category: "workshop",
                status: "registration",
                date: "2024-03-20",
                time: "09:00-12:00",
                location: "设计学院工作室",
                description: "学习最新的UI/UX设计理念和工具，通过实践项目提升设计技能。适合设计爱好者和初学者参加。",
                tags: ["设计工作坊", "实践项目", "小班教学"],
                icon: "🎨",
                participants: 25,
                maxParticipants: 30
            },
            {
                id: 3,
                title: "编程马拉松比赛",
                category: "competition",
                status: "soon",
                date: "2024-03-25",
                time: "24小时",
                location: "计算机实验室",
                description: "24小时编程马拉松，挑战你的编程极限！组队参赛，共同解决有趣的技术难题。",
                tags: ["编程比赛", "团队协作", "奖金丰厚"],
                icon: "🏆",
                participants: 80,
                maxParticipants: 100
            },
            {
                id: 4,
                title: "团队建设活动",
                category: "social",
                status: "upcoming",
                date: "2024-03-30",
                time: "14:00-18:00",
                location: "校园户外",
                description: "通过有趣的团队游戏和活动，增进成员间的了解和友谊，提升团队凝聚力。",
                tags: ["团队建设", "户外活动", "免费参与"],
                icon: "🤝",
                participants: 50,
                maxParticipants: 60
            },
            {
                id: 5,
                title: "人工智能前沿讲座",
                category: "tech",
                status: "registration",
                date: "2024-04-05",
                time: "19:00-21:00",
                location: "线上直播",
                description: "邀请AI领域专家，深入探讨人工智能的最新发展和应用前景。",
                tags: ["AI讲座", "线上直播", "专家分享"],
                icon: "🤖",
                participants: 150,
                maxParticipants: 500
            },
            {
                id: 6,
                title: "创新创业大赛",
                category: "competition",
                status: "soon",
                date: "2024-04-10",
                time: "09:00-17:00",
                location: "创新创业中心",
                description: "展示你的创新项目，获得投资机会和创业指导。优秀项目将获得资金支持。",
                tags: ["创新创业", "项目展示", "投资机会"],
                icon: "💡",
                participants: 30,
                maxParticipants: 40
            }
        ];

        let currentFilter = 'all';

        function toggleSidebar() {
            const sidebar = document.getElementById('sidebar');
            sidebar.classList.toggle('open');
        }

        function filterActivities(filter) {
            currentFilter = filter;
            
            // 更新筛选按钮状态
            document.querySelectorAll('.filter-btn').forEach(btn => {
                btn.classList.remove('active');
            });
            document.querySelector(`[data-filter="${filter}"]`).classList.add('active');
            
            // 重新渲染活动列表
            renderActivities();
        }

        function renderActivities() {
            const grid = document.getElementById('activitiesGrid');
            const filteredActivities = currentFilter === 'all' 
                ? activities 
                : activities.filter(activity => activity.category === currentFilter);
            
            grid.innerHTML = filteredActivities.map(activity => `
                <div class="activity-card">
                    <div class="activity-image">
                        ${activity.icon}
                        <div class="activity-status status-${activity.status}">
                            ${getStatusText(activity.status)}
                        </div>
                    </div>
                    <div class="activity-content">
                        <div class="activity-title">${activity.title}</div>
                        <div class="activity-meta">
                            <div class="meta-item">
                                <i class="fas fa-calendar"></i>
                                <span>${activity.date}</span>
                            </div>
                            <div class="meta-item">
                                <i class="fas fa-clock"></i>
                                <span>${activity.time}</span>
                            </div>
                            <div class="meta-item">
                                <i class="fas fa-map-marker-alt"></i>
                                <span>${activity.location}</span>
                            </div>
                        </div>
                        <div class="activity-description">${activity.description}</div>
                        <div class="activity-tags">
                            ${activity.tags.map(tag => `<span class="activity-tag">${tag}</span>`).join('')}
                        </div>
                        <div class="activity-actions">
                            <button class="action-btn" onclick="showActivityDetail(${activity.id})">
                                <i class="fas fa-eye"></i> 详情
                            </button>
                            <button class="action-btn primary" onclick="registerActivity(${activity.id})">
                                <i class="fas fa-user-plus"></i> 报名
                            </button>
                        </div>
                    </div>
                </div>
            `).join('');
        }

        function getStatusText(status) {
            const statusMap = {
                'upcoming': '即将开始',
                'registration': '报名中',
                'soon': '即将报名'
            };
            return statusMap[status] || status;
        }

        function showActivityDetail(id) {
            const activity = activities.find(a => a.id === id);
            if (activity) {
                const detailText = `
🎯 活动详情

活动名称：${activity.title}
活动时间：${activity.date} ${activity.time}
活动地点：${activity.location}
活动状态：${getStatusText(activity.status)}

📝 活动描述：
${activity.description}

🏷️ 活动标签：
${activity.tags.join('、')}

👥 参与情况：
已报名：${activity.participants}人
名额限制：${activity.maxParticipants}人
剩余名额：${activity.maxParticipants - activity.participants}人

📞 联系方式：
邮箱：activities@example.com
电话：138-0000-0000
                `;
                alert(detailText);
            }
        }

        function registerActivity(id) {
            const activity = activities.find(a => a.id === id);
            if (activity) {
                if (activity.participants >= activity.maxParticipants) {
                    alert('抱歉，该活动报名人数已满！');
                    return;
                }
                
                const confirmText = `确认报名参加"${activity.title}"？\n\n活动时间：${activity.date} ${activity.time}\n活动地点：${activity.location}\n\n报名后将收到确认邮件。`;
                
                if (confirm(confirmText)) {
                    alert('报名成功！请查收确认邮件。');
                    // 这里可以更新参与人数
                    activity.participants++;
                    renderActivities();
                }
            }
        }

        function updateCountdown() {
            // 设置目标日期（这里设置为15天后）
            const targetDate = new Date();
            targetDate.setDate(targetDate.getDate() + 15);
            
            const now = new Date();
            const difference = targetDate - now;
            
            if (difference > 0) {
                const days = Math.floor(difference / (1000 * 60 * 60 * 24));
                const hours = Math.floor((difference % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
                const minutes = Math.floor((difference % (1000 * 60 * 60)) / (1000 * 60));
                const seconds = Math.floor((difference % (1000 * 60)) / 1000);
                
                document.getElementById('days').textContent = days.toString().padStart(2, '0');
                document.getElementById('hours').textContent = hours.toString().padStart(2, '0');
                document.getElementById('minutes').textContent = minutes.toString().padStart(2, '0');
                document.getElementById('seconds').textContent = seconds.toString().padStart(2, '0');
            }
        }

        // 页面加载完成后初始化
        document.addEventListener('DOMContentLoaded', function() {
            renderActivities();
            
            // 启动倒计时
            updateCountdown();
            setInterval(updateCountdown, 1000);
            
            // 设置当前页面的导航项为激活状态
            document.querySelectorAll('.sidebar-nav li').forEach(li => {
                li.classList.remove('active');
            });
            document.querySelector('.sidebar-nav li:nth-child(5)').classList.add('active');
        });
    </script>
</body>
</html> 